﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using SAServices.Model;

namespace SAServices
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "ISAService" in both code and config file together.
    [ServiceContract]
    public interface ISAService
    {
        //category methods.
        //
        [OperationContract]
        List<CategoryInfo> GetRootCategories();

        [OperationContract]
        List<CategoryInfo> GetSubCategories(CategoryInfo parentCategory);

        [OperationContract]
        bool IsCategoryContainsFamilyFromVendor(CategoryInfo category, int vendorId, bool bIncludeSubCategory);

        [OperationContract]
        bool AddCategory(CategoryInfo newCategoryInfo);

        [OperationContract]
        bool DeleteCategory(Guid cateId);

        [OperationContract]
        bool UpdateCategory(CategoryInfo updateCategoryInfo);

        [OperationContract]
        CategoryInfo GetCategoryInfoByCateId(Guid cateId);

        //standard methods.
        //
        [OperationContract]
        bool AddStandard(StandardInfo newStandardInfo);

        [OperationContract]
        bool UpdateStandard(StandardInfo updateStandardInfo);

        [OperationContract]
        bool DeleteStandard(string standardName);

        [OperationContract]
        StandardInfo GetStandardByName(string standardName);

        [OperationContract]
        StandardInfo GetStandard(int standardId);

        [OperationContract]
        List<StandardInfo> GetAllStandards();

        //vendor methods.
        //
        [OperationContract]
        bool AddVendor(VendorInfo newVendorInfo);

        [OperationContract]
        bool UpdateVendor(VendorInfo updateVendorInfo);

        [OperationContract]
        bool DeleteVendor(string vendorName);

        [OperationContract]
        VendorInfo GetVendorByName(string vendorName);

        [OperationContract]
        VendorInfo GetVendor(int vendorId);

        [OperationContract]
        List<VendorInfo> GetAllVendors();

        //family & parameter methods.
        [OperationContract]
        bool PublishFamily(FamilyInfo familyInfo, FamilyAttrInfo familyAttrInfo, FamilyTableInfo familyTableInfo);

        [OperationContract]
        bool UpdateFamily(FamilyInfo familyInfo, FamilyAttrInfo familyAttrInfo, FamilyTableInfo familyTableInfo);

        [OperationContract]
        bool DeleteFamily(Guid familyId);

        [OperationContract]
        FamilyAttrInfo GetFamilyAttrInfoByType(Guid familyId, FamilyAttrType type);

        [OperationContract]
        FamilyAttrInfo GetFamilyAttrInfo(Guid familyId);

        [OperationContract]
        Byte[] GetFamilyThumbnailPic(Guid familyId);

        [OperationContract]
        List<FamilyInfo> GetFamiliesByCategoryId(Guid cateId);

        [OperationContract]
        List<FamilyInfo> GetFamiliesByCategoryIdnew(Guid cateId, string str, string searchString);

        [OperationContract]
        FamilyInfo GetFamilyInfo(Guid famiId);

        [OperationContract]
        List<FamilyInfo> GetFamilyInfoNew();

        [OperationContract]
        List<FamilyInfo> GetFamiliesByVendorId(int vendorId, string searchString);

        [OperationContract]
        List<FamilyInfo> GetFamiliesByCategoryVendorId(Guid cateId, int vendorId, string searchString,string str);

        [OperationContract]
        List<FamilyInfo> GetFamiliesByStandardId(int standardId);

        [OperationContract]
        List<FamilyInfo> SearchFamilies(string searchString);

        [OperationContract]
        List<FamilyInfo> SearchFamiliesByVendor(string searchString,int vendorid);

        [OperationContract]
        List<ParameterInfo> GetFamilyKeyParameters(Guid familyId);

        [OperationContract]
        List<ParameterInfo> GetFamilyParameters(Guid familyId);

        [OperationContract]
        ParameterInfo GetFamilyParameterInfo(Guid parameterId);

        [OperationContract]
        List<ParameterValueInfo> GetParamVals(Guid parameterId, List<ParameterValueInfo> paramConstrains);

        [OperationContract]
        ParameterValueInfo GetParamVal(Guid familyId, Guid instanceId, Guid parameterId);

        [OperationContract]
        System.Data.DataTable GetSubFamilyTable(Guid familyId, List<ParameterValueInfo> paramConstraints);

        [OperationContract]
        List<ParameterValueInfo> GetDriveParameterVals(Guid familyId, Guid instanceId);

        //inventor methods.
        //
        [OperationContract]
        Byte[] GeneratePart(Guid familyId, Guid instanceId, List<ParameterInfo> driveParams, string fileExtension);

        //cache methods.
        //
        [OperationContract]
        bool GenerateCache(Guid familyId);

        [OperationContract]
        bool DeleteCache(Guid familyId);

        [OperationContract]
        bool IsFamilyCached(Guid guid);

        [OperationContract]
        List<ParameterInfo> GetParameters(Byte[] modelData);

        [OperationContract]
         int CheckUserAuthority(string username);

        [OperationContract]
         bool ValidateUser(string username, string password);
    }
}
